import 'package:flutter/material.dart';
import 'package:yp/config/config.dart';

class ImageWidget extends StatefulWidget {
  final bool favorite_sign;
  ImageWidget(Key key, this.favorite_sign) : super(key: key);
  @override
  State<StatefulWidget> createState() {
    return ImageWidgetState();
  }
}

class ImageWidgetState extends State<ImageWidget> {
  bool colorBool;
  @override
  void initState() {
    super.initState();
    colorBool = widget.favorite_sign ?? false;
  }

  @override
  Widget build(BuildContext context) {
    // return Image.asset(
    //   'assets/images/fav_9.png',
    //   width: 20,
    //   height: 20,
    //   color: (colorBool == null || colorBool == false) ? null : Colors.red,
    // );

    return colorBool
        ? Icon(Icons.favorite_outlined, color: Config.mainColor)
        : Icon(Icons.favorite_outline, color: Colors.black26);
  }

  void onPressed(bool count) {
    setState(() {
      colorBool = count;
    });
  }
}
